package com.zhouxiaoge.queue.priority;

/**
 * @author 周小哥  gqzmy@163.com 2022/11/18 20:53
 */

public class Person implements Comparable<Person> {

    private Long id;

    private String name;

    public Person() {
    }

    public Person(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public int compareTo(Person person) {
        Long id1 = person.id;
        return this.id > person.getId() ? 1 : (this.id < person.getId() ? -1 : 0);
    }
}
